package com.ruoyi.points.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.points.mapper.PointsDetailMapper;
import com.ruoyi.points.domain.PointsDetail;
import com.ruoyi.points.service.IPointsDetailService;

/**
 * 积分明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-04
 */
@Service
public class PointsDetailServiceImpl implements IPointsDetailService 
{
    @Autowired
    private PointsDetailMapper pointsDetailMapper;

    /**
     * 查询积分明细
     * 
     * @param id 积分明细主键
     * @return 积分明细
     */
    @Override
    public PointsDetail selectPointsDetailById(Long id)
    {
        return pointsDetailMapper.selectPointsDetailById(id);
    }

    /**
     * 查询积分明细列表
     * 
     * @param pointsDetail 积分明细
     * @return 积分明细
     */
    @Override
    public List<PointsDetail> selectPointsDetailList(PointsDetail pointsDetail)
    {
        return pointsDetailMapper.selectPointsDetailList(pointsDetail);
    }

    /**
     * 新增积分明细
     * 
     * @param pointsDetail 积分明细
     * @return 结果
     */
    @Override
    public int insertPointsDetail(PointsDetail pointsDetail)
    {
        pointsDetail.setCreateTime(DateUtils.getNowDate());
        return pointsDetailMapper.insertPointsDetail(pointsDetail);
    }

    /**
     * 修改积分明细
     * 
     * @param pointsDetail 积分明细
     * @return 结果
     */
    @Override
    public int updatePointsDetail(PointsDetail pointsDetail)
    {
        pointsDetail.setUpdateTime(DateUtils.getNowDate());
        return pointsDetailMapper.updatePointsDetail(pointsDetail);
    }

    /**
     * 批量删除积分明细
     * 
     * @param ids 需要删除的积分明细主键
     * @return 结果
     */
    @Override
    public int deletePointsDetailByIds(Long[] ids)
    {
        return pointsDetailMapper.deletePointsDetailByIds(ids);
    }

    /**
     * 删除积分明细信息
     * 
     * @param id 积分明细主键
     * @return 结果
     */
    @Override
    public int deletePointsDetailById(Long id)
    {
        return pointsDetailMapper.deletePointsDetailById(id);
    }
}
